<?php
/**
 * Created by PhpStorm.
 * User: yy
 * Date: 2019/6/26
 * Time: 17:11
 */

namespace app\api\controller;

use app\common\service\environmentAnalysis\EnvironmentAnalysisControlService;

/**
 * 全要素分析-管控分析
 * Class EnvironmentAnalysisControl
 * @package app\api\controller
 */
class EnvironmentAnalysisControl extends BaseController
{

    /**
     * 行业运行趋势图
     * @author yy by 2019/6/26
     */
    public function getIndustryOperationTrend()
    {
        $param = $this->request->param();
        # 模拟数据
//        $param = ['start_time' => '2019-06-17', 'end_time' => '2019-06-23', 'region_id' => 53, 'station_id' => 0, 'plan_id' => 1, 'pollutant_name' => 'so2', 'industry_id' => 1];
        $list  = [];
        try {
            $environmentAnalysisControlService = new EnvironmentAnalysisControlService();
            $list                              = $environmentAnalysisControlService->getIndustryOperationTrend($param);
        } catch (\Exception $e) {
            $this->error($e->getMessage());
        }
        $this->success('成功', $list);
    }

    /**
     * 行业贡献度趋势图
     * @author yy by 2019/6/29
     */
    public function getIndustryContributionTrend()
    {
        $param = $this->request->param();
        # 模拟数据
//        $param = ['start_time' => '2019-06-17', 'end_time' => '2019-06-23', 'region_id' => 53, 'station_id' => 0, 'plan_id' => 1, 'industry_id' => 1, 'pollutant_name'=>'so2'];
        $list  = [];
        try {
            $environmentAnalysisControlService = new EnvironmentAnalysisControlService();
            $list                              = $environmentAnalysisControlService->getIndustryContributionTrend($param);
        } catch (\Exception $e) {
            $this->error($e->getMessage());
        }
        $this->success('成功', $list);
    }

}